/*
 * Map.h
 *
 *  Created on: 22/06/2011
 *      Author: Rafael
 */

#ifndef MAP_H_
#define MAP_H_

#include <rect.hpp>
#include "math/Matrix.h"
#include "Tile.h"

#include <string>
using namespace std;


class Map: public e2d::core::Rect {
protected:
	Matrix<Tile*> *tileMatrix;
	string mapName;
	int tile_width;
	int tile_height;
	string tileMapName;
public:
	Map();
	Map(TileMap *tileMap);
	virtual ~Map();

	void Load(TileMap* tileMap);
	void CreateMap(TileMap *tileMap, int layer);

	void Put(GameObject* obj);
	void Take(GameObject* obj);
	void tryMove(GameObject* obj, Point2D *step);
	virtual void onMove(GameObject* obj, Point2D *step) = 0;
	virtual void update(GameObject *obj) = 0;
	void testPortals(GameObject *obj);
	void tryStrike(GameObject* obj, Point2D *step);

    string getMapName() const;

    void setMapName(string name);

    void Test(GameObject *obj);
    string getTileMapName() const;
    void setTileMapName(string nextMap);

    void deleteMatrix();
};

#endif /* MAP_H_ */
